<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>创建一个假的 MongoId</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="mongoid.gettimestamp.html">MongoId::getTimestamp</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="mongoid.tostring.html">MongoId::__toString</a></div>
 <div class="up"><a href="class.mongoid.html">MongoId</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="mongoid.set-state" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">MongoId::__set_state</h1>
  <p class="verinfo">(PECL mongo &gt;= 1.0.8)</p><p class="refpurpose"><span class="refname">MongoId::__set_state</span> &mdash; <span class="dc-title">创建一个假的 MongoId</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-mongoid.set-state-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="type"><a href="class.mongoid.html" class="type MongoId">MongoId</a></span> <span class="methodname"><strong>MongoId::__set_state</strong></span>
    ( <span class="methodparam"><span class="type">array</span> <code class="parameter">$props</code></span>
   )</div>

  <p class="para rdfs-comment">
   该函数仅被 PHP 内部使用，用户不需要调用它。
  </p>
  <p class="para">
   它和下面的函数是一样的：
  </p>
  <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #007700">public&nbsp;static&nbsp;function&nbsp;</span><span style="color: #0000BB">__set_state</span><span style="color: #007700">(</span><span style="color: #0000BB">$props</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;new&nbsp;</span><span style="color: #0000BB">MongoId</span><span style="color: #007700">(</span><span style="color: #DD0000">"000000000000000000000000"</span><span style="color: #007700">);<br />}<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
  </div>

 </div>


 <div class="refsect1 parameters" id="refsect1-mongoid.set-state-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>

      <em><code class="parameter">props</code></em>
     </dt>

     <dd>

      <p class="para">
       从理论上讲，要用数组的属性来创建一个新 id。但是 MongoId 示例没有属性，所以这是没用的。
      </p>
     </dd>

       
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-mongoid.set-state-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   具有 &quot;000000000000000000000000&quot; 的值的 id。
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="mongoid.gettimestamp.html">MongoId::getTimestamp</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="mongoid.tostring.html">MongoId::__toString</a></div>
 <div class="up"><a href="class.mongoid.html">MongoId</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
